<?php
session_start();
$name = $_SESSION["adminname"];
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="description" content="xxxxx">
    <meta name="author" content="xxxxx">
    <meta name="keyword" content="xxxxx">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>罚款记录</title>
    <!-- start: Css -->
    <link rel="stylesheet" type="text/css" href="asset/css/bootstrap.min.css">
    <!-- plugins -->
    <link rel="stylesheet" type="text/css" href="asset/css/plugins/font-awesome.min.css"/>
    <link rel="stylesheet" type="text/css" href="asset/css/plugins/simple-line-icons.css"/>
    <link rel="stylesheet" type="text/css" href="asset/css/plugins/animate.min.css"/>
    <link rel="stylesheet" type="text/css" href="asset/css/plugins/fullcalendar.min.css"/>
    <link href="asset/css/style.css" rel="stylesheet">
    <!-- end: Css -->
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="asset/js/html5shiv.min.js"></script>
    <script src="asset/js/respond.min.js"></script>
    <![endif]-->
</head>

<body id="mimin" class="dashboard">
<!-- start: Header -->
<nav class="navbar navbar-default header navbar-fixed-top">
    <div class="col-md-12 nav-wrapper">
        <div class="navbar-header" style="width:100%;">
            <div class="opener-left-menu is-open"> <span class="top"></span> <span class="middle"></span> <span class="bottom"></span> </div>
            <a href="index_reader.php" class="navbar-brand"> <b>图书管理系统</b> </a>
            <ul class="nav navbar-nav navbar-right user-nav">
                <li class="user-name"><span><?php echo $name?></span></li>
                <li class="dropdown avatar-dropdown"> <img src="asset/img/avatar.jpg" class="img-circle avatar" alt="user name" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"/>
                    <ul class="dropdown-menu user-dropdown">
                        <li><a href="index.html"><span class="fa fa-power-off"></span> 退出登录</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
</nav>
<!-- end: Header -->
<div class="container-fluid mimin-wrapper">
    <!-- start:Left Menu -->
    <div id="left-menu">
        <div class="sub-left-menu scroll">
            <ul class="nav nav-list">
                <li>
                    <div class="left-bg"></div>
                </li>
                <li class="ripple"> <a  class="tree-toggle nav-header" id="left-menu-1"><span class="fa-home fa"></span> 首页 <span class="fa-angle-right fa right-arrow text-right"></span> </a>
                    <ul class="nav nav-list tree" >
                        <li><a href="index_reader.php">首页</a></li>
                    </ul>
                </li>
                <li class="ripple"> <a class="tree-toggle nav-header"  id="left-menu-2"> <span class="fa-diamond fa"></span> 图书管理 <span class="fa-angle-right fa right-arrow text-right"></span> </a>
                    <ul class="nav nav-list tree" >
                        <li><a href="borrowpage_reader.php">图书借阅</a></li>
                        <li><a href="returnpage_reader.php">图书归还</a></li>
                        <li><a href="Bstate_reader.php">图书状态</a></li>
                    </ul>
                </li>
                <li class="ripple active"> <a class="tree-toggle nav-header"  id="left-menu-3"><span class="fa fa-check-square-o"></span> 我的 <span class="fa-angle-right fa right-arrow text-right"></span> </a>
                    <ul class="nav nav-list tree" >
                        <li><a href="readerbor_reader.php">借阅记录</a></li>
                        <li><a href="readerfine_reader.php">罚款记录</a></li>
                        <li><a href="pwd_reader.php">修改密码</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>

    <!-- end: Left Menu -->

    <!-- start: content -->
    <div id="content">
        <div class="panel">
            <div class="panel-body">
                <div class="col-md-12">
                    <h3 class="animated fadeInLeft">罚款记录</h3>
                    <p class="animated fadeInDown"> 用户管理 <span class="fa-angle-right fa"></span> 罚款记录 </p>
                </div>
            </div>
        </div>
        <!--        <div class="col-md-12 padding-0 form-element">-->
        <!--            <div class="col-md-12">-->
        <!--                <div class="panel form-element-padding">-->
        <!--                    <div class="panel-heading">-->
        <!--                        <h4>查询条件</h4>-->
        <!--                    </div>-->
        <!--                    <form method="post" action="">-->
        <!--                    <div class="panel-body" style="padding-bottom:40px;">-->
        <!--                        <div class="form-group">-->
        <!--                            <label class="col-sm-1 control-label text-right">用户编号</label>-->
        <!--                            <div class="col-sm-2">-->
        <!--                                <input type="text" class="form-control" name="bookNo">-->
        <!--                            </div>-->
        <!--                        </div>-->
        <!--                        <div class="col-sm-2">-->
        <!--                            <input class="submit btn btn-danger" type="submit" value="提交">-->
        <!--                        </div>-->
        <!--                    </div>-->
        <!--                    </form>-->
        <!--                </div>-->
        <div class="panel">
            <div class="panel-heading">
                <h3>罚款记录</h3>
            </div>
            <div class="panel-body">
                <div class="responsive-table">
                    <div id="datatables-example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                        <div class="row">
                            <div class="col-sm-12">
                                <table class="table table-striped table-bordered dataTable no-footer" width="100%" cellspacing="0"  style="width: 100%;">
                                    <thead>
                                    <tr role="row">
                                        <th class="sorting_asc"style="width: 60px;">流水号</th>
                                        <th class="sorting" style="width: 60px;">图书编号</th>
                                        <th class="sorting" style="width: 60px;">读者号</th>
                                        <th class="sorting" style="width: 60px;">罚金</th>
                                        <th class="sorting" style="width: 60px;">受损结果</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php
                                    $mysqli = mysqli_connect("localhost", "root", "123456", "library");
                                    mysqli_query($mysqli,"SET NAMES 'utf8'");
                                    $readerNo = $_SESSION['adminno'];
                                    $sql = "select * from fine where readerNo='$readerNo'";
                                    $rowsult = $mysqli->query($sql);


                                    if ($rowsult->num_rows > 0) {
                                        // 输出数据
                                        $i = 0;
                                        while ($row = $rowsult->fetch_assoc()) {
                                            $i++;
                                            if ($i % 2 == 1)
                                                echo "\n<tr role=\"row\" class=\"odd\">";
                                            else
                                                echo "\n<tr role=\"row\" class=\"even\">";

                                            echo "\n<td> ", $row['serialNumber'], "</td>";
                                            echo "\n<td> ", $row['readerNo'], "</td>";
                                            echo "\n<td> ", $row['bookNo'], "</td>";
                                            echo "\n<td> ", $row['fine_money'], "</td>";
                                            echo "\n<td> ", $row['lossResult'], "</td>";
                                            echo "\n</tr>";
                                        }
                                    } else {
                                        echo "无结果";
                                    }
                                    // 释放结果集
                                    if($rowsult){
                                        mysqli_free_result($rowsult);
                                    }

                                    $mysqli->close();
                                    ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<!-- end: content -->
</div>
<!-- start: Javascript -->
<script src="asset/js/jquery.min.js"></script>
<script src="asset/js/jquery.ui.min.js"></script>
<script src="asset/js/bootstrap.min.js"></script>
<!-- plugins -->
<script src="asset/js/plugins/jquery.nicescroll.js"></script>
<!-- custom -->
<script src="asset/js/main.js"></script>
<!-- end: Javascript -->
<script>
    $("#left-menu-3").click() ;
</script>
</body>
</html>